package bp.net;

import java.util.ArrayList;
import java.util.List;

public class Layer{

	@SuppressWarnings("rawtypes")
	protected List nerves;
	
	public Layer(){}
	
	@SuppressWarnings("unchecked")
	public Layer(int count) {
		this.nerves = new ArrayList<Nerve>();
		for(int i=0;i<count;i++){
			this.nerves.add(new Nerve(this));
		}
	}
	public void compute(){
		for(Object o:this.nerves){
			Nerve n = (Nerve)o;
			n.compute();
		}
	}
	public int getNervesCount(){
		return this.nerves.size();
	}
	
	public Nerve getNerve(int index){
		return (Nerve) this.nerves.get(index);
	}
	
	@SuppressWarnings("rawtypes")
	public List getNerves() {
		return nerves;
	}
}
